<template>
  <el-row>
    <el-col>
      <vxe-table
              :data="tableData">
        <vxe-column type="seq" width="60"></vxe-column>
        <vxe-column field="createTime" title="时间"></vxe-column>
        <vxe-column field="visitIp" title="IP地址"></vxe-column>
        <vxe-column field="chineseName" title="操作"></vxe-column>
      </vxe-table>
      <vxe-pager
              @page-change="queryUserLogInfo"
              :current-page.sync="page.currentPage"
              :page-size.sync="page.pageSize"
              :total="page.totalResult"
              :layouts="['PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'FullJump', 'Total']">
      </vxe-pager>
    </el-col>
  </el-row>
</template>

<script>
  import {queryUserLog} from "@/api/oneseIf-centre";

  /**
   *{ 操作记录 }
   * @param:
   * @author: 宋康
   * @DateTime: 2022/7/1
   */
  export default {
    name: "OperatingRecord",
    data() {
      return {
        tableData: [],
        page: {
          currentPage: 1,
          pageSize: 10,
          totalResult: 0
        },
      }
    },
    mounted() {
      this.queryUserLogInfo({currentPage:this.page.currentPage,pageSize:this.page.pageSize});
    },
    methods: {
      queryUserLogInfo({currentPage, pageSize}) {
        this.page.currentPage = currentPage;
        this.page.pageSize = pageSize;
        queryUserLog(currentPage, pageSize).then(res => {
          let data = res.data;
          this.tableData = data.records;
          this.page.totalResult = data.total;
        })
      }
    }
  }
</script>

<style scoped>

</style>
